<script src="<?=n_js('charts','echarts')?>"></script>
<style>
.data-item div{display:inline-block;width:180px;text-align:center;margin:10px 0px;}
.data-item div b{font-size:20px;line-height:30px;color:#999;}
.data-item .boder-lr{border:solid #3891CA;border-width:0 1px 0 1px;}
</style>

<?php
	$compete1Info = $data['compete1'];
	$compete1wxDetail = $compete1Info['wxDetail'];
	$compete1wxRankByDay = $compete1Info['wxRankByDay'];
	$compete1wxRankByWeek = $compete1Info['wxRankByWeek'];
	$compete1wxIndexWeek = $compete1Info['wxIndexWeek'];
	$compete1wxArticleWeek = $compete1Info['wxArticleWeek'];
	$compete2Info = $data['compete2'];
	$compete2wxDetail = $compete2Info['wxDetail'];
	$compete2wxRankByDay = $compete2Info['wxRankByDay'];
	$compete2wxRankByWeek = $compete2Info['wxRankByWeek'];
	$compete2wxIndexWeek = $compete2Info['wxIndexWeek'];
	$compete2wxArticleWeek = $compete2Info['wxArticleWeek'];
?>

<div style="text-align: center;">
<form method="get" action="<?=n_url('weixin', 'compete')?>">
	<input type="text" name='compete1' value="<?=$compete1wxDetail['wxid']?>">
	<button>PK</button>
	<input type="text" name='compete2' value="<?=$compete2wxDetail['wxid']?>">
</form>
</div>


<div style="float:left;width:560px;padding-right:40px;border-right:1px dashed #999;">
	



	<div style="height:180px;text-align:right;margin-top:10px;">
		<div class="n-right" style="width:250px;">
			<img src="<?=$compete1wxDetail['face_url']?>" /><br />
			<?=$compete1wxDetail['wxname']?><br />
			<?=$compete1wxDetail['wxid']?><br />
		</div>
		<div style="width:100px;background-color:#3891CA;text-align:center;padding:10px 20px;font-size:20px;color:#fff;">
			<?=$compete1wxDetail['groupName']?>
		</div>
	</div>


	<dl class="n-box" style="margin-bottom:30px;">
		<dt class="n-box-head"><b>昨日</b></dt>
		<dd class="n-box-body data-item">
			<div>
				阅读数<br />
				<b><?=$compete1wxRankByDay['all_read_num']?></b>
			</div>
			<div class="boder-lr">
				点赞数<br />
				<b><?=$compete1wxRankByDay['all_like_num']?></b>
			</div>
			<div>
				日均阅读数<br />
				<b><?=$compete1wxRankByDay['average_read_num']?></b>
			</div>
			<div>
				最高阅读数<br />
				<b><?=$compete1wxRankByDay['max_read_num']?></b>
			</div>
			<div class="boder-lr">
				中自榜指数<br />
				<b><?=$compete1wxRankByDay['weixin_index']?></b>
			</div>
		</dd>
	</dl>


	<dl class="n-box" style="margin-bottom:30px;">
		<dt class="n-box-head"><b>一周指数</b></dt>
		<dd class="n-box-body">
			<div class="data-item">
				
				<div>
					阅读数<br />
					<b><?=$compete1wxRankByWeek['read_sum']?></b>
				</div>
				<div class="boder-lr">
					点赞数<br />
					<b><?=$compete1wxRankByWeek['like_sum']?></b>
				</div>
				<div></div>
			</div>
			<div id="chart1" style="height:200px;border:1px solid #999;">
			</div>

		</dd>
	</dl>


	<dl class="n-box" style="margin-bottom:30px;">
		<dt class="n-box-head"><b>一周热门</b></dt>
		<dd class="n-box-body">
			<ul class="a-hot-article">
				
			<?php
			foreach($compete1wxArticleWeek as $key=>$val){
			?>
				<li class="a-bottom-line n-sep-top">
					<p style="line-height: 30px;">
						<a href="<?=$val['url']?>" target="_blank">
							<?=$val['title']?>
						</a></p>
					<p class="a-summry">
						<?=$val['content168']?>
					</p>
					<p class="n-sep-bottom n-sep-top">
						<span class="n-right">
							<?=date('Y-m-d H:i:s',$val['ptime'])?>
						</span>
						阅读数<b><?=$val['read_num']?></b>，
						点赞数<b><?=$val['like_num']?></b>
						</p>
				</li>
			<?php
			}
			?>
			</ul>
		</dd>
	</dl>
</div>

<div style="margin-left:640px;">


	<div style="height:180px;margin-top:10px;">
		<div class="n-right" style="width:100px;background-color:#3891CA;text-align:center;padding:10px 20px;font-size:20px;color:#fff;margin:10px 10px;">
			<?=$compete2wxDetail['groupName']?>
		</div>
		<div style="width:250px;">
			<img src="<?=$compete2wxDetail['face_url']?>" /><br />
			<?=$compete2wxDetail['wxname']?><br />
			<?=$compete2wxDetail['wxid']?><br />
		</div>
	</div>


	<dl class="n-box" style="margin-bottom:30px;">
		<dt class="n-box-head"><b>昨日</b></dt>
		<dd class="n-box-body data-item">
			<div>
				阅读数<br />
				<b><?=$compete2wxRankByDay['all_read_num']?></b>
			</div>
			<div class="boder-lr">
				点赞数<br />
				<b><?=$compete2wxRankByDay['all_like_num']?></b>
			</div>
			<div>
				日均阅读数<br />
				<b><?=$compete2wxRankByDay['average_read_num']?></b>
			</div>
			<div>
				最高阅读数<br />
				<b><?=$compete2wxRankByDay['max_read_num']?></b>
			</div>
			<div class="boder-lr">
				中自榜指数<br />
				<b><?=$compete2wxRankByDay['weixin_index']?></b>
			</div>

		</dd>
	</dl>
	
	<dl class="n-box" style="margin-bottom:30px;">
		<dt class="n-box-head"><b>一周指数</b></dt>
		<dd class="n-box-body">

			<div class="data-item">
				
				<div>
					阅读数<br />
					<b><?=$compete2wxRankByWeek['read_sum']?></b>
				</div>
				<div class="boder-lr">
					点赞数<br />
					<b><?=$compete2wxRankByWeek['like_sum']?></b>
				</div>
				<div></div>
			</div>



		<div id="chart2" style="height:200px;border:1px solid #999;">
		</div>











		</dd>
	</dl>
	
	<dl class="n-box n-sep-top">
		<dt class="n-box-head"><b>一周热门</b></dt>
		<dd class="n-box-body">
			<ul class="a-hot-article">
				
				<?php
				foreach($compete2wxArticleWeek as $key=>$val){
				?>
				<li class="a-bottom-line n-sep-top">
					<p style="line-height: 30px;">
						<a href="<?=$val['url']?>" target="_blank">
							<?=$val['title']?>
						</a></p>
					<p class="a-summry">
						<?=$val['content168']?>
					</p>
					<p class="n-sep-bottom n-sep-top">
						<span class="n-right">
							<?=date('Y-m-d H:i:s',$val['ptime'])?>
						</span>
						阅读数<b><?=$val['read_num']?></b>，
						点赞数<b><?=$val['like_num']?></b>
						</p>
				</li>
				<?php
				}
				?>
			</ul>
	</dl>
</div>



		<script>
		<?php
		$charts1 = n_mod('charts');
		$charts1->type('line');
		$charts1->toolbox();
		$charts1->legend("一周指数");
		$charts1->x(array_keys($compete2wxIndexWeek));
		$charts1->data("一周指数",'line',array_values($compete2wxIndexWeek));
		$charts1->show('compete1wxIndexWeek');
		
		$charts2 = n_mod('charts');
		$charts2->type('line');
		$charts2->toolbox();
		$charts2->legend("一周指数");
		$charts2->x(array_keys($compete2wxIndexWeek));
		$charts2->data("一周指数",'line',array_values($compete2wxIndexWeek));
		$charts2->show(compete2wxIndexWeek);
		?>
		</script>



<script type="text/javascript">
	require.config({
		paths: {
			echarts: '/charts/js'
		}
	});
	require(
		[
		'echarts',
		'echarts/chart/bar',
		'echarts/chart/line'
		],
		function (ec) {
			var myChart1 = ec.init(document.getElementById('chart1'));
			myChart1.setOption(compete1wxIndexWeek);

			var myChart2 = ec.init(document.getElementById('chart2'));
			myChart2.setOption(compete2wxIndexWeek);
		}
	);
</script>